package com.xiaoma.feign.fallback;

import com.xiaoma.feign.EsFeignService;
import entity.Goods;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import utils.R;

/**
 * @Author: xiaoma
 * @Date: 2021/8/3 16:01
 * @description: Feign远程调用失败回调
 */
@Component
@Slf4j
public class SearchFeignServiceFallBack implements EsFeignService {
    @Override
    public R productGoods(Goods goods) {
        log.info("熔断方法被调用");
        return R.error(666, "fallback");
    }

    @Override
    public R queryProductGoodsInEs(String keyword) {
        log.info("熔断方法被调用");
        return R.error(666, "fallback");
    }
}
